<?php

defined('MYLITS') ? '' : exit('No direct script access allowed');

/**
 * @version     1.0.0
 * @package     mylits engine
 * @license     GNU General Public License version 3
 * @author      Arfan Fudyartanto D N <arfan@mylits.com> - http://engine.mylits.com
 */
class Mylits_Error {

    private static $instance;

    private function __construct() {
        
    }

    /**
     * This method will return Mylits_Error object
     * 
     * @return object Mylits_Language
     */
    public static function getInstance() {
        if (is_null(self::$instance)) {
            self::$instance = new self();
        }
        return self::$instance;
    }

    /**
     * Method to assign error content
     * 
     * @param string $template -> name of error template, 
     * the template can be found in 'engine/templates/{templatename}.error.php'
     * 
     * @param string $content
     */
    public static function assign($template, $content) {
        ob_start();
        include ENGINE_DIR . '/templates/' . $template . '.error.php';
        echo ob_get_clean();
    }

}

?>
